<?php
/* This file is part of Mirasol CMS
   (C) 2011 by Alban Technologies. Written by Chris Alban Hansen.
   Released under the terms of the GNU General Public License.
   See COPYING in the top level directory of the Mirasol CMS installation. */

include "{$_SERVER['DOCUMENT_ROOT']}/includes/config.php";

/* Fields */
$sample_fields1 = <<<END
<template>
<field type="text" name="headline" label="Headline" />
<field type="html" name="content" label="Content" />
</template>
END;

$sample_fields2 = <<<END
<template>
<field type="text" name="headline" label="Headline" />
<field type="text" name="version" label="Version number" />
<field type="text" name="copyright" label="Copyright" />
<field type="text" name="license" label="License" />
</template>
END;

/* Pages */
$sample_page1 = <<<END
<page>
<title>Front page</title>
<fields>
<headline>Welcome to a $app_name powered website</headline>
<content>&lt;p&gt;Hello, world!&lt;/p&gt;</content>
</fields>
</page>
END;

$app_copyright_enc = htmlentities ($app_copyright, ENT_COMPAT, "UTF-8", true);
$sample_page2 = <<<END
<page>
<title>About</title>
<fields>
<headline>About $app_name</headline>
<version>$app_version</version>
<copyright>$app_copyright_enc</copyright>
<license>$app_license</license>
</fields>
</page>
END;

/* Layouts */
$sample_layout1 = <<<END
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:php="http://php.net/xsl" version="1.0">

  <xsl:output method="xml" version="1.0" indent="yes" encoding="utf-8"
    omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN"
    doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>
          <xsl:value-of select="page/title" disable-output-escaping="yes" />
          |
          <xsl:value-of select="\$sitename" />
        </title>
      </head>
      
      <body>
        <h1><xsl:value-of select="page/fields/headline" disable-output-escaping="yes" /></h1>
        <xsl:value-of select="page/fields/content" disable-output-escaping="yes" />
        <p><img src="/images/poweredby.png" alt="Powered by Mirasol CMS" /></p>
      </body>
      
    </html>
  </xsl:template>
</xsl:stylesheet>
END;

$sample_layout2 = <<<END
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:php="http://php.net/xsl" version="1.0">

  <xsl:output method="xml" version="1.0" indent="yes" encoding="utf-8"
    omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN"
    doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>
          <xsl:value-of select="page/title" disable-output-escaping="yes" />
          |
          <xsl:value-of select="\$sitename" />
        </title>
      </head>
      
      <body>
        <h1><xsl:value-of select="page/fields/headline" disable-output-escaping="yes" /></h1>
        <p>
          <strong>Version: </strong><xsl:value-of select="page/fields/version" disable-output-escaping="yes" />
        </p>
        <p>
          <strong><xsl:value-of select="page/fields/copyright" disable-output-escaping="yes" /></strong><br />
          <xsl:value-of select="page/fields/license" disable-output-escaping="yes" />
        </p>
      </body>
      
    </html>
  </xsl:template>
</xsl:stylesheet>
END;

$newlayout = <<<END
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:php="http://php.net/xsl" version="1.0">

  <xsl:output method="xml" version="1.0" indent="yes" encoding="utf-8"
    omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN"
    doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>
          <xsl:value-of select="page/title" disable-output-escaping="yes" />
          |
          <xsl:value-of select="\$sitename" />
        </title>
      </head>
      
      <body>
        <xsl:comment />
      </body>
      
    </html>
  </xsl:template>
</xsl:stylesheet>
END;
?>
